# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgbase=pangomm
pkgname=(pangomm pangomm-docs)
pkgver=2.46.3
pkgrel=1
pkgdesc="C++ bindings for Pango"
url="https://www.gtkmm.org/"
arch=(loong64 x86_64)
license=(LGPL)
depends=(pango glibmm cairomm)
makedepends=(git meson mm-common glibmm-docs cairomm-docs)
options=(!emptydirs)
_commit=1712231caf8886d73bd64964814793f19f6e1d70  # tags/2.46.3^0
source=("git+https://gitlab.gnome.org/GNOME/pangomm.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd pangomm
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd pangomm
}

build() {
  arch-meson pangomm build -D maintainer-mode=true
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package_pangomm() {
  depends+=(libsigc-2.0.so libglibmm-2.4.so libcairomm-1.0.so)
  provides=(libpangomm-1.4.so)

  meson install -C build --destdir "$pkgdir"

  # Split -docs
  mkdir -p docs/usr/share
  mv -t docs/usr/share "$pkgdir"/usr/share/{devhelp,doc}
}

package_pangomm-docs() {
  pkgdesc+=" (documentation)"
  depends=()
  options=(!strip)

  mv -t "$pkgdir" docs/*
}

# vim:set sw=2 sts=-1 et:
